package com.fourthGroup.service.Impl;
import com.fourthGroup.model.User;
import com.fourthGroup.service.UserService;
import org.springframework.stereotype.Service;
import java.util.HashMap;
import java.util.Map;

@Service
public class UserServiceImpl implements UserService {

    // 用于存储模拟的用户数据
    private Map<Integer, User> UserData;
    
    public UserServiceImpl() {
        UserData = new HashMap<>();
        
        User user1 = new User(1, "宋炫磊", "123", "1234567890");
        User user2 = new User(2, "炫磊宋", "123", "1234567890");
        User user3 = new User(3, "磊炫宋", "123", "1234567890");
        User user4 = new User(4, "炫宋磊", "123", "1234567890");
        
        UserData.put(user1.getUid(), user1);
        UserData.put(user2.getUid(), user2);
        UserData.put(user3.getUid(), user3);
        UserData.put(user4.getUid(), user4);
    }

    @Override
    public User queryUserById(Integer uid) {
        return UserData.get(uid);
    }
}
